/**
 * @projectName: study-demo
 * @author: 小飞
 * @description: TODO
 * @date: 2024/9/9 15:30
 * @version: 1.0
 */
package com.home.config.minioConfig;


import com.home.utils.MinioUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 项目启动时加载配置
 */

@Component
@Slf4j
public class InitConfig implements InitializingBean {

    @Autowired
    private MinioUtil minioUtil;


    @Autowired
    private MinioConfig minioConfig;

    @Override
    public void afterPropertiesSet() throws Exception {
        // 项目启动创建Bucket，不存在则进行创建
        minioUtil.createBucket(minioConfig.getBucketName());
    }
}
